package com.platform.system.enums;

import lombok.Getter;

/**
 * @author Huangkai
 */

@Getter
public enum ModelTypeEnum {

    DouBao(0,"", "豆包"),

    MiniMax(1, "MiniMaxModel", "miniMax")
    ;

    /**
     * 状态码
     * */
    public Integer code;

    /**
     * 实现类
     */
    private String impl;
    /**
     * 提示信息
     * */
    public String desc;

    /**
     * @param code 状态码
     * @param desc
     * */
    ModelTypeEnum(Integer code, String impl, String desc) {
        this.code = code;
        this.impl = impl;
        this.desc = desc;
    }

    public static ModelTypeEnum findEnumByCode(Integer code) {
        for (ModelTypeEnum statusEnum : ModelTypeEnum.values()) {
            if (statusEnum.getCode().equals(code)) {
                //如果需要直接返回name则更改返回类型为String,return statusEnum.name;
                return statusEnum;
            }
        }
        throw new IllegalArgumentException("code is invalid");
    }
}
